import Taro, { Component } from '@tarojs/taro';
import PropTypes from 'prop-types';
import { View, Text, Image } from '@tarojs/components';
import AutoFormId from "@/components/autoFormId/index";
import './index.scss'

class MedicinecabinetItem extends Component {
    static defaultProps = {
        medicalkit: {},
        isTap: true,
    }
    constructor(props) {
        super(props)
    }
    componentWillMount() {
    }
    render() {
        let { medicalkit, isTap } = this.props
        return (
            <AutoFormId renderCat={
                <View className='medicalkit-item pt-3-5 pb-5 bdr_10 ft26'>
                    <View className='line-b pb-3 pl-3-5 pr-3-5 top-info'>
                        <View className='flex flex-r flex-item-between ft_w600 number fc_000'>
                            <Text>编号：{medicalkit.MedicalkitID}</Text>
                            {
                                isTap ? <Image style={{ width: Taro.pxTransform(16), height: Taro.pxTransform(26) }} src={require('../../assets/imgs/home/home_icon_pressed.png')} /> : null
                            }
                        </View>
                        <View className='pt-2'>领用时间：{medicalkit.gettime}</View>
                    </View>
                    <View className='pl-3-5 pr-3-5 bottom-info'>
                        <View className='pt-3 fc_FF8'>
                            <Text>领取人：{medicalkit.userget}</Text>
                            <Text className='ml-6'>领用科室：{medicalkit.departmentname}</Text>
                        </View>
                        <View className='pt-2 fc_65C'>存放：{medicalkit.wardname}</View>
                    </View>
                    {
                        medicalkit.status === 3 ? <Image className='state-img' src={require('../../assets/imgs/notedhs/img_note_hs.png')}></Image> : null
                    }
                </View>
            }
            ></AutoFormId>
        )
    }
}

MedicinecabinetItem.propTypes = {
    name: PropTypes.object,
    isTap: PropTypes.bool
};
export default MedicinecabinetItem